import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { SqlSugarPagedList } from '/@/api/BaseDto';
import { BaseKeywordPageInput } from '/@/api/BaseDto';

import { BasXueYeChanPinFeiYongInput } from './dto/BasXueYeChanPinFeiYongInput';
import { BasXueYeChanPinFeiYongOutput } from './dto/BasXueYeChanPinFeiYongOutput';
import { BasXueYeChanPinFeiYongAllOutput } from './dto/BasXueYeChanPinFeiYongAllOutput';

export type { BasXueYeChanPinFeiYongInput, BasXueYeChanPinFeiYongOutput, BasXueYeChanPinFeiYongAllOutput };

const service = 'BasXueYeChanPinFeiYong/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasXueYeChanPinFeiYongApi = {
	page: (data: BaseKeywordPageInput) => {
		return axiosPost<SqlSugarPagedList<BasXueYeChanPinFeiYongOutput>>(service + 'page', data);
	},
	all: () => {
		return axiosPost<BasXueYeChanPinFeiYongAllOutput[]>(service + 'all', {});
	},
	get: (id: number) => {
		return axiosGet<BasXueYeChanPinFeiYongOutput>(service + `get/${id}`);
	},
	add: (data: BasXueYeChanPinFeiYongInput) => {
		return axiosPost<number>(service + 'add', data);
	},
	update: (data: BasXueYeChanPinFeiYongInput) => {
		return axiosPut<boolean>(service + 'update', data);
	},
};
